package datasorter;

abstract class DataSorter<T> {
	/**
	 * Sort array of elements T type
	 * 
	 * @param data input array
	 * @return sorted array
	 */
	public abstract T[] sort(T[] data);

	/**
	 * Sort array of elements T type with specified type
	 * @param type sort type
	 */
	public abstract T[] sort(T[] data, SortType type);

	/**
	 * Reverses the input array
	 * 
	 * @param data input array
	 */
	protected void reverse(Integer[] data) {
		for (int i = 0; i < data.length / 2; i++) {
			int temp = data[i];
			data[i] = data[data.length - 1 - i];
			data[data.length - 1 - i] = temp;
		}
	}
}